﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EasyDLL;
using EasyDLL.Net;

namespace WebForm.Net
{
    public partial class MailWrapperTest : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void SendMailClick(object sender, EventArgs e)
        {
            MailWrapper mail = new MailWrapper("qianlf2008@163.com", "411066636@qq.com", "test", "test",null);
            mail.SendFailureEvent += mail_SendFailureEvent;
            mail.AddAttachments("d:\\2.zip");
            mail.SendAsync(sendCompeleted);
            Response.Write(DateTime.Now+"    send..");
        }

        private void sendCompeleted(object sender, AsyncCompletedEventArgs e)
        {
            Response.Write(DateTime.Now+"    ok");
        }

        void mail_SendFailureEvent(object sender, ExceptionEventArgs e)
        {
            Response.Write(e.FailureException.Message);
        }
    }
}